
function register() {
    var ch = document.getElementById('ch');
    
    if (ch.checked==false){
        alert("未勾选同意！无法注册！");
    }else{
        $.ajax({
            url:'register',
            type:'post',
            data:{
                'account':document.getElementById('userAccount').value,
                'name':document.getElementById('userName').value,
                'pwd':document.getElementById('userPwd').value,
                'pwd1':document.getElementById('userPwd1').value,
                'phone':document.getElementById('userPhone').value,
                'email':document.getElementById('userEmail').value,
                'phone':document.getElementById('userPhone').value,
                'carTypes':document.getElementById('userCarTypes').value,
                'travType':document.getElementById('travType').value
            },
            async:true,
            dataType: 'JSON',
            success:function (resp) {
                console.log(resp);
                alert(resp.message);
                if (resp.id == 0){
                    window.location.href = resp.location;
                }
            },
            error:function (err) {
                alert('请联系管理员！');
            }
        })
    }
    
}